import Form from './components/Form'
import FormItem from './components/FormItem'
import Input from './components/Input'
import Checkbox from './components/Checkbox'
import CheckboxGroup from './components/CheckboxGroup'
import Radio from './components/Radio'
import RadioGroup from './components/RadioGroup'
import Message from './components/Message'
import Table from './components/Table'
import Tree from './components/Tree'

const components = {
  Form,
  FormItem,
  Input,
  Checkbox,
  CheckboxGroup,
  Radio,
  RadioGroup,
  Table,
  Tree,
}

const install = function(Vue, options) {
  Object.keys(components).forEach(name =>
    Vue.component(`S${name}`, components[name])
  )
}

const API = {
  install,
}

export const SForm = Form
export const SFormItem = FormItem
export const SInput = Input
export const SCheckbox = Checkbox
export const SCheckboxGroup = CheckboxGroup
export const SRadio = Radio
export const SRadioGroup = RadioGroup
export const SMessage = Message
export const STable = Table
export const STree = Tree

export default API
